package org.jhulk.sprites;

import java.util.ArrayList;

public class Squad
{
	public ArrayList<Marine> marines;

	public ArrayList<Marine> flamers;
	
	public ArrayList<Marine> sergents;
	
    public String name;

    public Squad()
    {
    	this.marines = new ArrayList<Marine>();
    	this.flamers = new ArrayList<Marine>();
    	this.sergents = new ArrayList<Marine>();
    }
    
    /**
     * Loop through all units and call their draw method
     */
    public void renderSquad()
    {
    	for(Marine m : this.getAllUnits()) {
			if(m.doRender()) m.draw();
		}
    }
    
    public ArrayList<Marine> getAllUnits()
    {
    	ArrayList<Marine> retArray = new ArrayList<Marine>();
    	retArray.addAll(this.getMarines());
    	retArray.addAll(this.getFlamers());
    	retArray.addAll(this.getSergents());
    	
    	return retArray;
    }
    
    public void addMarine(Marine m)
    {
        this.marines.add(m);
    }
    
    public void addFlamer(Marine f) {
    	this.flamers.add(f);
    }
    
    public void addSergent(Marine s) {
    	this.sergents.add(s);
    }
    
	public ArrayList<Marine> getMarines() {
		return marines;
	}

	public void setMarines(ArrayList<Marine> marines) {
		this.marines = marines;
	}

	public ArrayList<Marine> getFlamers() {
		return flamers;
	}

	public void setFlamers(ArrayList<Marine> flamers) {
		this.flamers = flamers;
	}

	public ArrayList<Marine> getSergents() {
		return sergents;
	}

	public void setSergents(ArrayList<Marine> sergents) {
		this.sergents = sergents;
	}    
	
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
